package ratarata2;

import java.io.*;

public class KonsolInput {

    public static double ambilDouble(String pertanyaan) {
        String strbilangan = null;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        double bilangan;

        System.out.print(pertanyaan);
        try {
            strbilangan = br.readLine();
        } catch (IOException ioe) {
            System.out.println("Kesalahan IO, program berhenti");
            System.exit(1);
        }

        bilangan = Double.parseDouble(strbilangan);
        return bilangan;
    }

}
